﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using JXT.PrimaryKey.Batman.Domain.Models;

namespace JXT.PrimaryKey.Batman.Domain.Specifications
{
    /// <summary>
    /// 包含排序条件的查询对象
    /// </summary>
    /// <typeparam name="TEntity">模型类型</typeparam>
    public interface IOrderedSpecification<TEntity> : ISpecification<TEntity> where TEntity : IEntity
    {
        /// <summary>
        /// 输入排序条件
        /// </summary>
        /// <typeparam name="TProperty">属性类型</typeparam>
        /// <param name="orderExpression">排序表达式</param>
        /// <param name="type">排序方式</param>
        void OrderBy<TProperty>(Expression<Func<TEntity, TProperty>> orderExpression, OrderType type = OrderType.Ascending);
    }
}
